<?php
// after having last insert id of table #_site, insert to table #_site_url

// insert into table page, page_current_revision, page_revision, page_url, template_site
$sqls_insert = array(
    "INSERT INTO public.".$user_site_prefix."workflow (site_id,name,url,creation_datetime,last_update,type,master_layout_revision) VALUES ('".$this->siteId."','dev','".$this->site->sub_domain.".admin.".Settings::BACKEND_DOMAIN."',null,null,'1','1');",
    "INSERT INTO public.".$user_site_prefix."workflow (site_id,name,url,creation_datetime,last_update,type,master_layout_revision) VALUES ('".$this->siteId."','live','".$this->site->sub_domain.".".Settings::FRONTEND_DOMAIN."',null,null,'2','1');",
    "INSERT INTO public.".$user_prefix."site_url (site_id,url,status,creation_datetime,last_update) VALUES ('".$this->siteId."','".$this->site->sub_domain.'.'.$domain."','t','".$current_datetime."',null);",
);

if ($this->site->custom_domain!='')
{
    $sqls_insert[] = "INSERT INTO public.".$user_prefix."site_url (site_id,url,status,creation_datetime,last_update) VALUES ('".$this->siteId."','".$this->site->custom_domain."','t','".$current_datetime."',null);";
}

